/**
 * Created by huotaol on 2017/5/16.
 */
import React, {Component} from "react";
import {Text, View, WebView} from "react-native";
import CustomStyle from "../../../common/style/CustomStyle";
import {connect} from "react-redux";
import SectionTitle from "../../main/mainUI/components/SectionTitle";


class DescriptionUI extends Component {
    static propTypes = {
        data: {},
    };

    render() {
        const {data} = this.props;
        const html = `<div id="youkuplayer" style="width:100%;height:100%"></div>
            <script type="text/javascript" src="http://player.youku.com/jsapi"></script>
            <script type="text/javascript">
            player = new YKU.Player('youkuplayer',{
            styleid: '0',
            client_id: '181ec051d71a6180',
            vid: 'XMjU3MDU5MDcyOA==',
            newPlayer: true
            });
            </script>`;

        return (
            <View style={[this.props.style, {flex: 1}]}>
                <WebView
                    automaticallyAdjustContentInsets={false}
                    style={{
                        height: CustomStyle.getActualSizeInVertical(500),
                        width: CustomStyle.screenWidth,
                    }}
                    source={{html}}
                    javaScriptEnabled
                    domStorageEnabled
                    startInLoadingState
                    scalesPageToFit
                    decelerationRate="normal"
                />
                <SectionTitle title='员工展示' rightText='换一批'
                              rightClick={() => {
                              }} showArrow={false}/>
                <Text
                    style={[CustomStyle.baseText, {
                        fontSize: CustomStyle.getActualFontSize(28),
                        color: 'black',
                        marginLeft: CustomStyle.getActualSizeInHorizontal(16),
                    }]}>暂无员工数据</Text>
            </View>
        );
    }
}

export default connect()(DescriptionUI);